package com.itheima.dao;

import com.itheima.pojo.Blog;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;
import java.util.Map;

@Repository
public interface BlogMapper extends Mapper<Blog> {

    @Select("SELECT * FROM t_blog b , t_blog_sort bs , t_tag t WHERE b.`tag_uid` = t.`uid` AND b.`blog_sort_uid` = bs.`uid` AND b.`content` LIKE CONCAT('%',#{keyWord},'%') OR b.`title` LIKE CONCAT('%',#{keyWord},'%')")
    List<Map> findAllByKeyword(String keyword);
}
